package com.lxyk.sgq;

import com.alibaba.nacos.api.NacosFactory;
import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.exception.NacosException;

import java.util.Properties;

public class NacosConfigTest {

    public static void main(String[] args) throws NacosException {

        Properties properties = new Properties(){{
          put("serverAddr","127.0.0.1:8848");
          put("namespace","08a9cbaf-a442-468c-9bc9-3153bca994e1");
        }};

        ConfigService configService = NacosFactory.createConfigService(properties);

        String config = configService.getConfig("sgq.yaml", "DEFAULT_GROUP", 1000);

        System.out.println(config);

    }
}
